package com.xuecheng.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xuecheng.base.model.PageResult;
import com.xuecheng.learning.model.dto.MyCourseTableParams;
import com.xuecheng.learning.model.dto.XcChooseCourseDto;
import com.xuecheng.learning.model.dto.XcCourseTablesDto;
import com.xuecheng.learning.model.po.XcCourseTables;

/**
 * @author VectorX
 * @version V1.0
 * @description 我的课程表service接口
 * @date 2024-04-28 16:19:47
 */
public interface MyCourseTablesService extends IService<XcCourseTables>
{
    /**
     * 添加选课
     *
     * @param userId   用户id
     * @param courseId 课程id
     * @return com.xuecheng.learning.model.dto.XcChooseCourseDto
     */
    XcChooseCourseDto addChooseCourse(String userId, Long courseId);

    /**
     * 判断学习资格
     *
     * @param userId
     * @param courseId
     * @return XcCourseTablesDto 学习资格状态
     * <pre>{@literal
     * [
     *     {
     *         "code": "702001",
     *         "desc": "正常学习"
     *     },
     *     {
     *         "code": "702002",
     *         "desc": "没有选课或选课后没有支付"
     *     },
     *     {
     *         "code": "702003",
     *         "desc": "已过期需要申请续期或重新支付"
     *     }
     * ]
     * }</pre>
     */
    XcCourseTablesDto getLearningStatus(String userId, Long courseId);

    /**
     * 保存选课成功状态
     *
     * @param chooseCourseId
     * @return
     */
    boolean saveChooseCourseSuccess(String chooseCourseId);

    /**
     * @param params
     * @return com.xuecheng.base.model.PageResult<com.xuecheng.learning.model.po.XcCourseTables>
     * @description 我的课程表
     * @author Mr.M
     * @date 2022/10/27 9:24
     */
    PageResult<XcCourseTables> mycourestabls(MyCourseTableParams params);

}
